Attribute VB_Name = "OilGasCalc"
Public Function GetPwf(n As Long, rg As Double, ro As Double, rw As Double, tt As Double, tw As Double, qw As Double, qsc As Double, d2 As Double, d1 As Double, e As Double, h As Double, p As Double) As Double
Dim pressure As New GasWellAlgor.CondFlow
GetPwf = pressure.PsSinFlow(1, 1, n, ro, rw, rg, 0, 0, 0, tt, tw, 0, qw, qsc, d2, d1, e, h, h, p)
End Function

Public Function GetCriticQ(a0 As Double, rg As Double, denL As Double, d As Double, a As Double, z As Double, p As Double, t As Double) As Double
Dim liqCurr As New GasWellAlgor.LiqCarrCri
Dim v As Double
Dim denG As Double
denG = 3484.4 * rg * p / (z * t)
v = liqCurr.LccV(a0, denG, denL, a)
GetCriticQ = liqCurr.LccQ(d, p, t, z, v)
End Function

Public Function GetZ(rg As Double, p As Double, t As Double) As Double
Dim ppc As Double, tpc As Double
Dim params As New GasWellAlgor.PhysiParams
Call params.GasCritParam(1, rg, tpc, ppc)
Dim ppr As Double, tpr As Double
ppr = p / ppc: tpr = t / tpc
GetZ = params.DeviaFactor(ppr, tpr)
End Function
